{% extends 'adminOut.html' %}
{% block main %}
<ol class="breadcrumb">
    <li><a href="/admin">管理首页</a></li>
    <li><span>内容列表</span></li>
</ol>
<h3>内容列表</h3>
{%include 'page.html'%}
<table class="table table-hover table-striped">
    <tr>
        <th>ID</th>
        <th>分类名称</th>
        <th>标题</th>
        <th>作者</th>
        <th>添加时间</th>
        <th>阅读量</th>
        <th>操作</th>
    </tr>
    {% for c in contents %}
    <tr>
        <td>{{c._id.toString()}}</td>
        <td>{{c.category.name}}</td>
        <td>{{c.title}}</td>
        <td>{{c.user.userName}}</td>
        <td>{{c.addTime|date('Y-m-d H:i:s',-8*60)}}</td>
        <td>{{c.views}}</td>
        <td>
            <a href="/admin/content/edit?id={{c.id.toString()}}">修改</a>
            <a href="/admin/content/delete?id={{c.id.toString()}}">删除</a>
        </td>
    </tr>
    {% endfor %}
</table>
{%include 'page.html'%}
{%endblock%}